<?php
$page_title="Manage Member Participation Information ";
include("includes/header.php");

$prgmem_id=(int)$_GET["prgmem_id"];

if($prgmem_id==0){

$prgId=(int)$_GET["prgId"];
$mem_id=(int)$_GET["mem_id"];
if($prgId>0){
$prg_info=@array_pop(qry_data("select prg_mem_id from bkitc_program_members where program_id=$prgId and member_id=$mem_id"));
 $prgmem_id=$prg_info["prg_mem_id"];	
}

}
$mode=$_GET["mode"];

if($mode=="edit"){
 	$prg_info=@array_pop(qry_data("select M.*,PM.*,P.* from bkitc_programs P  JOIN bkitc_program_members PM ON P.prg_id=PM.program_id  JOIN bkitc_profiles M ON M.registrant_id=PM.member_id where prg_mem_id=".$prgmem_id));
 	
 	
$atmp1=explode(" ",$prg_info["arr_time"]);
$prg_info["arr_time_sec"]=$atmp1[1];
$atmp2=explode(":",$atmp1[0]);
$prg_info["ahrs"]=$atmp2[0];
$prg_info["amins"]=$atmp2[1];
$adtmp1=explode(" ",$prg_info["dep_time"]);
$prg_info["dep_time_sec"]=$adtmp1[1];
$dtmp2=explode(":",$adtmp1[0]);
$prg_info["dhrs"]=$dtmp2[0];
$prg_info["dmins"]=$dtmp2[1];

 	}



?>				
<div class="fleft">
<ul class="subMenu">

<li><a href="javascript:history.back();">Back to  List </a></li>
<li><a href="prg_list.php?mode=result">Program List </a></li>
</ul>
</div>
<div class="cleardiv"></div>
	<div style="width:100%" class="content_bg">
	<form method="post" action="edit_prg_mem_pro.php?prgmem_id=<?=$prgmem_id?>" > 
		<table " width="600"  cellpadding="8" border="0" cellspacing="3"> 
			<tr>
				<td  height="10" style="padding:2px;margin:2px" colspan="2" align="right"><small style="font-size:11px"> <i><?=ast()?>  Required fields.</i></small></td>
			</tr>
			
			<tr><td colspan="2" class="section_head">Program Information</td></tr>
			<tr >
				<td width="150" class="frmLabel" colspan="2"><span style="font-size:17px"><?=$prg_info["prg_title"]?></span><br/>
				From : <?=$prg_info["prg_date"]?> to <?=$prg_info["prg_last_date"]?>				<br/>
				Location : <?=$prg_info["prg_location"]?><br/>
				Address :<?=$prg_info["prg_address"]?> <br/>
				
				
				 </td>
				
			</tr>
			
			<tr><td colspan="2" class="section_head">Member Information</td></tr>
			<tr >
				<td colspan="2" class="frmLabel1">
				<div style="float:left">
				 <?=formatMemberCode($prg_info["registrant_id"])?> <br/>
				<?=$prg_info["full_name"]?><br/>
				<?=$prg_info["email_id"]?><br/>
				<?=$prg_info["mobile_no"]?><br/>
				<?=$prg_info["reg_city"]?><br/>
				
				
				<br/>
				<div style="float:left;margin-top:10px;">
				Invited On : <?=$prg_info["invited_date"]?>
				</div>
				<div style="float:left;margin-top:10px;">
				Attending Status : <select disabled="true"><option value="0" >Open</option><option value="1" <?=$prg_info["acc_status"]==1?"selected":""?>>Accepted</option><option value="2" <?=$prg_info["acc_status"]==2?"selected":""?>>Cancelled</option></select> 
				<?$permLetter="Not Uploaded yet"; ?>
				Permission Letter : <span>
					<?
					if($prg_info["permission_letter"]!=""){
					$prgmid=$prg_info["prg_mem_id"];
					$permLetter=" <a target='_blank' href='data/permission/".$prgmid."/".$prg_info["permission_letter"]."'>Download</a>";
					$permLetter.= " Uploaded on ".$prg_info["permission_letter_on"];
					}
					
					?>
					<?=$permLetter?>

				
				</span><br/>
				</div>
				</div>
				
				</td>
				
				
			</tr>
			
			<tr><td colspan="2" class="section_head">Arrival & Departure Details : </td></tr>
			
			<tr><td  class="frmLabel" valign="top">
			Arriving via :
			</td>
			<td>
			<input type="radio" name="journey_via" id="t1" value="1"   <?=$prg_info["journey_via"]==1?"checked":""?> /><label for="t1"  >Train</label>
			<input type="radio" name="journey_via" id="t2" value="2"  <?=$prg_info["journey_via"]==2?"checked":""?>  /><label for="t2" >Road</label>
			<input type="radio" name="journey_via" id="t3" value="3" <?=$prg_info["journey_via"]==3?"checked":""?> /><label for="t3" >Air Flight</label>
			
			</td></tr>
			
			<tr><td  class="frmLabel" valign="top">
			Arriving at Venue :
			</td>
			<td>
		
			<textarea name="arr_venue" id="arr_venue"  class="txtarea" cols="100" rows="3"><?=$prg_info["arr_venue"];?></textarea>		
			
			</td>
			
			</tr>
			<tr>
				<td width="260" class="frmLabel">Expected Arrival Date/Time : <?=ast()?></td>
				<td > 
				
					<script language="javascript">
					<?
						if($prg_info["dt_arrival"]=="") 
							echo "DateInput('dt_arrival', true, 'YYYY-MM-DD')";
						else
							echo "DateInput('dt_arrival', true, 'YYYY-MM-DD','".$prg_info['dt_arrival']."')";
					?>
					</script>
					<span>IST Time <input maxlength="2" onkeypress="return allowNumbersOnly(event)" type="text" value="<?=$prg_info["ahrs"]?>"  class="txtbox" size="2" id="ahrs" name="ahrs"> Hours  <input type="text" class="txtbox" size="2" value="<?=$prg_info["amins"]?>" onkeypress="return allowNumbersOnly(event)" id="amins" name="amins" > Minutes  </span> <input type="radio" name="arr_time_sec" id="at1" value="AM" <?=$prg_info["arr_time_sec"]=="AM"?"checked":""?> /><label for="at1" >AM</label>
					<input type="radio" name="arr_time_sec" id="at2" value="PM" <?=$prg_info["arr_time_sec"]=="PM"?"checked":""?> /><label for="at2" >PM</label> 
				</td>
			</tr>
			
			<tr>
				<td width="260" class="frmLabel">Expected Departure Date/Time : <?=ast()?></td>
				<td > 
				
					<script language="javascript">
					<?
						if($prg_info["dt_departure"]=="") 
							echo "DateInput('dt_departure', true, 'YYYY-MM-DD')";
						else
							echo "DateInput('dt_departure', true, 'YYYY-MM-DD','".$prg_info['dt_departure']."')";
					?>
					</script>
					<span>IST Time <input value="<?=$prg_info["dhrs"]?>" id="dhrs" name="dhrs" maxlength="2" onkeypress="return allowNumbersOnly(event)" type="text"  class="txtbox" size="2"> Hours 
					<input value="<?=$prg_info["dmins"]?>" type="text" class="txtbox" size="2" onkeypress="return allowNumbersOnly(event)" id="damins" name="dmins"> Minutes  </span> <input type="radio" name="dep_time_sec" id="dt1" value="AM" <?=$prg_info["dep_time_sec"]=="AM"?"checked":""?> /><label for="dt1" >AM</label>
					<input type="radio" name="dep_time_sec" id="dt2" value="PM" <?=$prg_info["dep_time_sec"]=="PM"?"checked":""?> /><label for="dt2" >PM</label> 
				
				

				</td>
			</tr>
		<tr><td  class="frmLabel" valign="top">
			Departing from Venue :
			</td>
			<td>
		
			<textarea name="dep_venue" id="dep_venue"  class="txtarea" cols="100" rows="3"><?=$prg_info["dep_venue"];?></textarea>		
			
			</td>
			
			</tr>
    
			<!--<tr><td  class="frmLabel" valign="top" colspan="2">
				 :  <input type="radio" name="journey_cab" id="tcab1" <?=$prg_info["journey_cab"]==1?"checked":""?> value="1"/><label for="tcab1" >Yes</label>  <input type="radio" name="journey_cab" id="tcab2" <?=$prg_info["journey_cab"]==0?"checked":""?> value="0"/><label for="tcab2" >No</label>&nbsp; ( If Yes Provide Details)	
				<textarea name="journey_notes" id="mem_notes"  class="txtarea" cols="100" rows="3"><?=$prg_info["mem_notes"];?></textarea>		
			</td>
			</tr>-->
			
				<td class="frmLabel" colspan="2">Member's Notes/Special Request,if any<br/><span>(like Driver accompanying,Food to be without spices,Non diabetic food etc.)</span><textarea name="mem_notes" id="mem_notes"  class="txtarea" cols="100" rows="3"><?=$prg_info["mem_notes"];?></textarea></td>
			</tr>
		
			
			<tr><td colspan="2" class="section_head">Other Information</td></tr>
			<tr >
				<td colspan="2" class="frmLabel">Final Status :
				
				<?=createSelect("final_status", $prg_final_status,  $selected = $prg_info["final_status"])?>
				
				
				  </td>
			</tr>
			<tr>
				<td class="frmLabel" colspan="2">Admin Notes <br/><textarea name="admin_notes" id="admin_notes"  class="txtarea" cols="100" rows="3"><?=$prg_info["admin_notes"];?></textarea></td>
			</tr>
			
			
			
		</table>
		<div style="float:right"><input type="submit" class="button" style="width:150px"   value="Save Changes" /></div>
	</form>
</div>

<div style="margin-bottom:40px">

</div>



<? include("includes/footer.php");?>
